<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/footer.css" />
		<link rel="stylesheet" type="text/css" href="../../css/swiper-3.4.2.min.css" />
		<link rel="stylesheet" type="text/css" href="css/manager.css"/>
		<script src="../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/layer-v3.1.0/layer/layer.js"></script>
		<link href="../../js/layer-v3.1.0/layer/theme/default/layer.css" />
		<style type="text/css">
			.option-d{float: right; width:60%!important; height:auto!important;padding: 0.06rem; border: 1px solid #ddd;}
			.list1{
				position: relative;
				left: 1.2rem;
				display: none;
			}
			.list2{
				position: relative;
				left: 0.416666rem;
				display: none;
			}
			.list3{
				position: relative;
				left: 0.416666rem;
				display: none;
			}
			.list11{
				position: relative;
				left: 1.2rem;
				display: none;
			}
			.list22{
				position: relative;
				left: 0.416666rem;
				display: none;
			}
			.list33{
				position: relative;
				left: 0.416666rem;
				display: none;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<div id="main">
				<div id="header" style="background: #f7f7f7;">
					<a id="headImg" href="MyInte.html"><img class="headImg" src="../../images/12.png" /></a>
					<a href="shenqingAdd.html"><!-- <p id="" style="font-size: 12px;float: left;line-height: 1.180555rem;margin-left: 1rem;color: #e93340;margin-top: 0.09rem;">积分申请</p>--></a>
					<a href="checkListing.html"><p id="" style="font-size: 12px;float: right;line-height: 1.180555rem;margin-right: 0.2rem;color: #e93340;">审核结果</p></a>
				</div>
				<div id="content">
					<div style="padding-top: 0.2rem;">
						<div class="selectBtn" style="border-right: 1px solid #DCDCDC;color: #e93340;">申请奖分</div>
						<a href="./shenqingDel.html"><div class="selectBtn" style="">申请扣分</div></a>
						<div style="clear: both"></div>
					</div>
					<ul class="list-group reqList" style="margin-top: 0.2rem;">
					  	<li class="list-group-item"> 奖分人：<span id="shenheren1">张某某  ▼ </span>
					  	<ul class="list11">
					  		<li>▼ 吉林省智城智家科技有限公司 
					  			<ul class="list22">
					  				<li>▼ 产品部
					  					<ul class="list33">
					  						<li>部门负责人 张某某</li>
					  						<li>部门经理 张某某</li>
					  						<li>员工 张某某</li>
					  					</ul>
					  				</li>
					  				<li>▼ 设计部
					  					<ul class="list33">
					  						<li>设计部门负责人 刘某某</li>
					  					</ul>
					  				</li>
					  				<li>▼ 开发部
					  					<ul class="list33">
					  						<li>开发部门负责人 李某某</li>
					  					</ul>
					  				</li>
					  			</ul>
					  		</li>
					  		
					  	</ul>	
					  </li>							
					  <li class="list-group-item">
					  	<span>奖分申请类型：</span>
					  	<span id="optJf">
					  		<!--<select name="" class="option-d selectType" style="float: right;"  >
					  			<option value="0">--请选择--</option>
							  	<option value="1">日报</option>
							  	<option value="2">工作任务</option>
							  	<option value="3">日常维护</option>
							  	<option value="4">工作表现</option>
							  	<option value="5">成长表现</option>
							</select>-->
					  	</span>
					  </li>
					  <li class="list-group-item">奖分申请标准：
					  	<span>
					  		<select name="" class="option-d selectBiaozhun" style="float: right;">
							  	<option value="0">--请选择--</option>
							  	<!--<option value="1">工作日志</option>
							  	<option value="2">工作总结</option>
							  	<option value="">项目开发</option>
							  	<option value="">原型设计</option>
							  	<option value="">市场推广</option>
							  	<option value="">渠道拓展</option>
							  	<option value="">培训课程</option>
							  	<option value="">网络推广</option>
							  	<option value="">文案策划</option>
							  	<option value="">平面设计</option>
							  	<option value="">财务核算</option>
							  	<option value="">打扫办公室</option>
							  	<option value="">绿植养护</option>
							  	<option value="">工作积极</option>
							  	<option value="">超额完成任务</option>
							  	<option value="">延迟完成任务</option>
							  	<option value="">没有完成任务</option>
							  	<option value="">工作消极</option>
							  	<option value="">加班</option>
							  	<option value="">考核优异</option>
							  	<option value="">考核低劣</option>-->
							  </select>
					  	</span>
					  </li>
					  <li class="list-group-item">申请积分数：
					  	<span>
					  		<select name="" id=""class="option-d selectJifen" style="float: right;">
							  	<option value="">--请选择--</option>
							  	<!--<option value="">10积分</option>
							  	<option value="">5积分</option>-->
							  </select>
					  	</span>
					  </li>
					  <li class="list-group-item">
					  	<span>申请理由：</span>  
					  	<span style="color: #DBDBDB">请输入申请积分理由（必填）</span>
					  	<textarea  id="sqly" style="border: 1px solid #E6E6E6; outline: none; resize: none;width: 100%;height: 3.472222rem;margin-top: 0.1rem;"></textarea>
					  </li>
					  <li class="list-group-item">审核人：<span id="shenheren">张某某</span>
					  	<ul class="list1">
					  		<li>▼ 吉林省智城智家科技有限公司 
					  			
					  			<ul class="list2">
					  				<li>▼ 产品部
					  					<ul class="list3">
					  						<li>部门负责人 张某某</li>
					  						<li>部门经理 张某某</li>
					  						<li>员工 张某某</li>
					  					</ul>
					  				</li>
					  				<li>▼ 设计部
					  					<ul class="list3">
					  						<li>设计部门负责人 刘某某</li>
					  					</ul>
					  				</li>
					  				<li>▼ 开发部
					  					<ul class="list3">
					  						<li>开发部门负责人 李某某</li>
					  					</ul>
					  				</li>
					  			</ul>
					  		</li>
					  		
					  	</ul>	
					  </li>
					</ul>
					
					<div>
						<p class="btnFoot" style="height: auto; font-size: 0.45rem; line-height: 1rem;">提交</p>
					</div>
										
				</div>
				</div>
			</div>
			<div id="foot" class="row">
				<a class="foot col-xs-3 col-sm-3" href="../kaoqin/index2.html">
					<img class="footImg" src="../../images/guanlixuanzhong.png" />
					<p>管理</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../coalition/colalition.html">
					<img class="footImg" src="../../images/lianmengchushi.png" />
					<p>联盟</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../store/store.html">
					<img class="footImg" src="../../images/11.png" />
					<p>商城</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../personage/personIndex.html">
					<img class="footImg" src="../../images/13.png" />
					<p>我的</p>
				</a>
			</div>
		

	</body>
	<script src="../../js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/bootstrap-3.3.7-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/handlebars-v2.0.0.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/rhAdmin.js" type="text/javascript" charset="utf-8"></script>
	
	
	<script type="text/javascript">
		window.onload = function(){
			$(".btnFoot").click(function(){
				/*$(".btnFoot").addClass("btnhve");
				layer.msg("提交成功");
				setTimeout(function(){
					window.location.href = './checkListing.html'
				},500)*/
				alert("奖分人："+$('#shenheren1').html());
				var obj = document.getElementById("jfPeople"); //定位id
				var index = obj.selectedIndex; // 选中索引
				var text = obj.options[index].text; // 选中文本
				var value = obj.options[index].value; // 选中值
				alert("类型，被选中的文本："+text+",被选中的值："+value);
				alert("申请理由："+$('#sqly').val());
				alert("审核人："+$('#shenheren').html());
				
				var json = 
			{
				"subId":"fn",
				"subName":"小二放牛",
				"subDuty":"后端攻城狮",
				"subAccount":"97000937",
				"subSection":"技术部",
				"integralTypeId":""+obj.options[index].value+"",
				"integralTypeName":""+obj.options[index].text+"",
				"integralNormId":"",
				"integralNormName":"",
				"integralCount":"",
				"integralPrizebuckle":"0",
				"backup6":"1",
				"checkFirst":"lvzheng"
			};
			
			$.ajax({
				url: "http://10.0.47.157:5555/companyapplyfor-service/leaveGoOut/sub",
				type: "PUT",
				data: json,
				success: function(data) {
					console.log(data);
					if(data.code == 1){
						layer.msg("提交成功");
						setTimeout(function(){window.location="../shjg/sqjg.html";},1000);
					}
				},
				error: function(e) {
					console.log('提交请假申请失败！', e);
				}
			})
			})
		}
		$('#shenheren').on('click',function(){
			$('.list1').show();
			event.stopPropagation();
		})
		
		
		$('#shenheren1').on('click',function(){
			$('.list11').show();
			event.stopPropagation();
		})
		
		$('.list11>li').on('click',function(){
			if ($(this).children('.list22').is(":hidden")) {
				$(this).children('.list22').show()
			}else{
				$(this).children('.list22').hide()
			}
			event.stopPropagation();
		})
		$('.list22>li').on('click',function(){
			if ($(this).children('.list33').is(":hidden")) {
				$(this).children('.list33').show()
			}else{
				$(this).children('.list33').hide()
			}
			event.stopPropagation();
		})
		$('.list33>li').on('click',function(){
			$('#shenheren1').html($(this).html())
			$('.list11').hide();
			event.stopPropagation();
		})
		
		$('.list1>li').on('click',function(){
			if ($(this).children('.list2').is(":hidden")) {
				$(this).children('.list2').show()
			}else{
				$(this).children('.list2').hide()
			}
			event.stopPropagation();
		})
		$('.list2>li').on('click',function(){
			if ($(this).children('.list3').is(":hidden")) {
				$(this).children('.list3').show()
			}else{
				$(this).children('.list3').hide()
			}
			event.stopPropagation();
		})
		$('.list3>li').on('click',function(){
			$('#shenheren').html($(this).html())
			$('.list1').hide();
			event.stopPropagation();
		})
		var type1,type2,type3,selectTemp;
		$('.selectType').change(function(){
		 	type1 =  +$(this).val();
		 	switch (type1){
		 		case 0:
		 			selectTemp ='<option value="0">--请选择--</option>'
		 			$('.selectBiaozhun').html(selectTemp)
		 			selectTemp= '<option value="0">--请选择--</option>'
		 			$('.selectJifen').html(selectTemp)	
		 			break;
		 		case 1:
		 			selectTemp ='<option value="0">--请选择--</option>' +
		 						'<option value="1">工作日志</option>' +
							  	'<option value="1">工作总结</option>'
		 			$('.selectBiaozhun').html(selectTemp)
		 			break;
		 		
		 		case 2:
		 		selectTemp = 	'<option value="0">--请选择--</option>' +
							  	'<option value="1">原型设计</option>' +
		 						'<option value="1">项目开发</option>' +
							  	'<option value="1">原型设计</option>' +
							  	'<option value="1">市场推广</option>' +
							  	'<option value="1">渠道拓展</option>' +
							  	'<option value="1">培训课程</option>' +
							  	'<option value="1">网络推广</option>' +
							  	'<option value="1">文案策划</option>' +
							  	'<option value="1">平面设计</option>' +
							  	'<option value="1">财务核算</option>' 
		 			$('.selectBiaozhun').html(selectTemp)
		 			break;
		 		case 3:
		 		selectTemp = 	'<option value="0">--请选择--</option>' +
		 						'<option value="2">打扫办公室</option>' +
							  	'<option value="2">绿植养护</option>' 
		 			$('.selectBiaozhun').html(selectTemp)
		 			break;
		 		case 4:
		 			selectTemp= '<option value="0">--请选择--</option>' +
		 						'<option value="2">工作积极</option>' +
							  	'<option value="2">超额完成任务</option>' +
							  	'<option value="2">加班</option>'
		 			$('.selectBiaozhun').html(selectTemp)	
		 			break;
		 		case 5:
		 		selectTemp= 	'<option value="0">--请选择--</option>' +
		 						'<option value="2">考核优异</option>'
		 			$('.selectBiaozhun').html(selectTemp)	
		 				
		 			break;	
		 		default:
		 			break;
		 	}
		 		$('.selectJifen').html('<option value="0">--请选择--</option>')
		})
		
		$('.selectBiaozhun').change(function(){
			type2 =  +$(this).val();
			switch (type2){
				case 0:
				
				selectTemp= '<option value="0">--请选择--</option>'
		 						$('.selectJifen').html(selectTemp)	
					break;
				case 1:
					selectTemp= 
								'<option value="1">10积分</option>'
		 						$('.selectJifen').html(selectTemp)	
					break;
				case 2:
					selectTemp= 
								'<option value="1">5积分</option>'
		 						$('.selectJifen').html(selectTemp)	
					break;	
			
				default:
					break;
			}
		})
		
		
		$(function() {
			//加载该企业的积分类型列表
			totalTypeList();
		});
		function totalTypeList(){
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://10.0.47.157:5555/attencepoint-service/tfPointStandardListAll?biId=1",
				async: false,
				success: function(data) {
					console.log(data);
					if(data != null){
						var html = '<select id="jfPeople" class="option-d selectType" style="float: right;"  ><option value="0">--请选择--</option>';
						for(var i=0;i<data.length;i++){
							html += '<option value="'+(i+1)+'">'+data[i].psName+'</option>';
						}
						html += '</select>';
						document.getElementById('optJf').innerHTML = html;
					}
				}
			});
		}
	</script>

</html>